/**
 * Free software.
 */

package org.nanhill.xsheet.input;

import java.io.IOException;
import java.io.InputStream;

import org.dom4j.DocumentException;
import org.nanhill.commons.pattern.Director;
import org.nanhill.commons.pattern.Factory;
import org.nanhill.xsheet.XSheetParseException;
import org.nanhill.xsheet.model.XSheetModel;

/**
 * @author alin [xalinx at gmail dot com]
 * @date 2006-12-1
 */
public interface InputBuilder extends Factory<XSheetModel>, Director {
	void construct() throws XSheetParseException;

	/*
	 * Get produced sheet model.
	 * 
	 * @see org.nanhill.commons.pattern.Factory#getProduct()
	 */
	XSheetModel getProduct();

	/**
	 * Reed sheet from input stream.
	 * 
	 * @param is
	 * @throws XSheetParseException
	 * @throws DocumentException
	 */
	void read(InputStream is) throws IOException, XSheetParseException;

}
